<template>
  <div class="container container-waterfall">
    <div class="item">
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index<2"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index>=1"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index<1"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index>=2"></el-image>
      </div>
    </div>
     <div class="item">
       <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index<1"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index>=2"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index<2"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index>=1"></el-image>
      </div>
      
    </div>
    <div class="item">
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index<2"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index>=1"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index<1"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index>=2"></el-image>
      </div>
    </div>
     <div class="item">
       <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index<1"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index>=2"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index<2"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index>=1"></el-image>
      </div>
      
    </div>
    <div class="item">
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index<2"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index>=1"></el-image>
      </div>
      <div class="item-2">
        <el-image class="item-max" v-for="(item,index) in detailsMaxUrl" :key="index"  ref="detailsheight" :src="detailsMaxUrl[index].url" alt="" fit="cover" v-show="index<1"></el-image>
      </div>
      <div class="item-1">
        <el-image class="item-min"  v-for="(item,index) in detailsMinUrl" :key="index"  ref="detailsheight" :src="detailsMinUrl[index].url" alt="" fit="cover" v-show="index>=2"></el-image>
      </div>
    </div>
    <el-button type="text" @click="dialogVisible = true">点击打开Dialog</el-button>
    <el-dialog
      title="懒精灵色彩艺术中心"
      :visible.sync="dialogVisible"
      width="960px"
      :before-close="handleClose"
      center
      >
      <div class="dialog-theme">
        <h3>高迪彩片系列</h3>
        <el-image src="http://r4kwyi39b.hd-bkt.clouddn.com/theme.png" fil="contain"></el-image>
      </div>
      <div class="dialog-item">
        <div class="dialog-list">
          <h3 class="dialog-list-title">美学起源</h3>
          <span>灵感来源于西拔牙建筑设计大师“高迪”，充分运用彩色瓷片拼贴镶嵌，构成诗一般的流动意境。工艺上采用“铠甲”罩面结构。致密抗水、耐污、耐擦洗，坚固柔韧，抗开裂。灵感来源于西拔牙建筑设计大师“高迪”，充分运用彩色瓷片拼贴镶嵌，构成诗一般的流动意境。</span>
        </div>
        <div class="dialog-list">
          <h3 class="dialog-list-title">产品特色</h3>
          <el-image src="http://r4kwyi39b.hd-bkt.clouddn.com/item.png" fil="contain"></el-image>
        </div>
        <div class="dialog-list">
          <h3 class="dialog-list-title">建议使用</h3>
          <el-image src="http://r4kwyi39b.hd-bkt.clouddn.com/homebg.png" fil="contain"></el-image>
        </div>
        <div class="dialog-list">
          <h3 class="dialog-list-title">系列色卡</h3>
          <el-image src="http://r4kwyi39b.hd-bkt.clouddn.com/homebg.png" fil="contain"></el-image>
        </div>
      </div>
      

      <span slot="footer" class="dialog-footer">
      </span>
    </el-dialog>

  </div>
</template>

<script>
import './css.css'
export default {
  data(){
    return{
      detailsMinUrl:null,
      detailsMaxUrl:null,
      dialogVisible: false
    }
  },
  created(){
    this.getData()
  },
  methods:{
    //获取数据
    async getData(){
      const {data:ret} = await this.$http.get('http://www.codefly.top/static/img.json')
      console.log(ret)
      
      this.detailsMinUrl= ret.detailsMin
      console.log(this.detailsMinUrl[0].url)
      this.detailsMaxUrl = ret.detailsMax
    },
    handleClose() {
    }
  },
  mounted(){
    // this.getData()
  }
}
</script>

<style lang='less' scoped>
  .container-waterfall{
    
    .item{
      display: flex;
      flex-direction: column;
      flex-wrap: wrap;
      height: 605.04px;
      .item-1{
      position: relative;
      display: flex;
      width: 50%;
      height: 200px;
      box-sizing: border-box;
      .item-min{
        width: 100%;
        // height: 50%;
      }
      }
      .item-2{
        position: relative;
        display: flex;
        width: 50%;
        box-sizing: border-box;
        .item-min{
          width: 100%;
          font-size:0;
        }
      }
    }
    
  }

</style>